package com.xuecheng.content.api;

import com.xuecheng.content.model.dto.CourseCategoryDto;
import com.xuecheng.content.service.CourseCategoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author luhao
 * @ClassName CourseCategoryController.java
 * @Description 课程分类控制器
 * @createTime 2023/5/18
 */
@RestController
@Api(tags = "课程分类api")
public class CourseCategoryController {
    @Autowired
    private CourseCategoryService courseCategoryService;
    @GetMapping("/course-category/tree-nodes")
    @ApiOperation(value = "查询课程分类树形展示")
    public List<CourseCategoryDto> findByTree(){
        List<CourseCategoryDto> courseCategoryDtos = courseCategoryService.queryByNodes("1");
        return courseCategoryDtos;
    }
}
